package pdm.traj.entity;

public class PartInfo {
	private String ip;
	private String port;
//	private String key;
	
	public PartInfo() {
        ip = "192.9.200.10";
        port = "6379";
    }
	public PartInfo(String ip, String port) {
		this.ip = ip;
		this.port = port;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public String getPort() {
		return port;
	}
	public void setPort(String port) {
		this.port = port;
	}
//	public String getKey() {
//		return key;
//	}
//	public void setKey(String key) {
//		this.key = key;
//	}
	
//	@Override
//	public boolean equals(PartInfo that){
//		return (this.ip == that.ip && this.port == that.port);
//	}
	@Override
	public boolean equals(Object obj){
        try {
            PartInfo that = (PartInfo) obj;
            return (this.ip.equals(that.ip) && this.port.equals(that.port));
        } catch (Exception e) {
            return false;
        }
	}	
	
	@Override
	public int hashCode() {
		return ip.hashCode() * 1007 + port.hashCode();
	}
	
}
